home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr47 / wasm223.zip / SERIAL7.ASM < prev    next >
Assembly Source File  |  1993-05-04  |  1KB  |  50 lines

  1. ;********************************;
  2. ; WASM Serial I/O, Line Status   ;
  3. ; By Eric Tauck                  ;
  4. ;                                ;
  5. ; Defines:                       ;
  6. ;                                ;
  7. ;   ComRng  return ring state    ;
  8. ;   ComCar  return carrier state ;
  9. ;                                ;
  10. ; Requires:                      ;
  11. ;                                ;
  12. ;   SERIAL1.ASM                  ;
  13. ;********************************;
  14.  
  15.         jmps    _serial7_end
  16.  
  17. ;========================================
  18. ; Return ring state.
  19. ;
  20. ; In: BX= serial record.
  21. ;
  22. ; Out: CY= set if ring.
  23.  
  24. ComRng  PROC    NEAR
  25.         mov     dx, [bx+_COM_MODEMSTAT] ;modem status
  26.         in      al, dx                  ;get byte
  27.         and     al, 40H                 ;mask bit
  28.         sub     ah, ah                  ;zero
  29.         sub     ah, al                  ;set carry if high
  30.         ret
  31.         ENDP
  32.  
  33. ;========================================
  34. ; Return carrier state.
  35. ;
  36. ; In: BX= serial record.
  37. ;
  38. ; Out: CY= set if carrier detected.
  39.  
  40. ComCar  PROC    NEAR
  41.         mov     dx, [bx+_COM_MODEMSTAT] ;modem status
  42.         in      al, dx                  ;get byte
  43.         and     al, 80H                 ;mask bit
  44.         sub     ah, ah                  ;zero
  45.         sub     ah, al                  ;set carry if high
  46.         ret
  47.         ENDP
  48.  
  49. _serial7_end
  50.